package com.zhai.boot.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @package: com.zhai.boot.task
 * @project-name: zhai-boot
 * @description: demo 定时任务
 * @author: Created by 翟凤玺
 * @create-datetime: 2018-8-24 13:07
 */
@Slf4j
@Component
@EnableScheduling
public class DemoTask {

    private static final String BUSINESS_NAME = "【demo 定时任务】";
    private static final String SYS_TIME = "当前系统时间：";

    //@Scheduled(fixedDelayString = "1000")
    public void demo() {
        log.info(BUSINESS_NAME + SYS_TIME + new Date());
    }
}
